

import Tool from "../common/Tool";
import DBMgr from "../db/DBMgr";
import MsgMgr from "../event/MsgMgr";
import Global from "../Global";
import SimpleTip from "./SimpleTip";


export default class TipMgr  {
    private static _prev: string;
    private static _time: number = 0;
    public static showTip(content: string) {
        var t: number = new Date().getTime();
        // if (this._prev == content && t - this._time <= 1800) return;
        this._prev = content;
        var tip: SimpleTip = SimpleTip.create(content, (t - this._time));
        cc.find("Canvas").addChild(tip);
        tip.zIndex = 2;
        this._time = t;
    }

    public static langTip(id: number) {
        this.showTip(DBMgr.getLang(id));
    }

    public static showAlert() {

    }
    public static errTip(err: number) {
        MsgMgr.emit("ON_RET_ERROR",err);
    }
}